package com.yalu.action.data;

import java.util.List;


import javax.annotation.Resource;

import net.sf.json.JSONArray;

import org.apache.struts2.convention.annotation.ParentPackage;

import com.yalu.action.base.BaseAction;
import com.yalu.entity.data.Warehousesarea;
import com.yalu.service.data.WarehousesareaService;

@ParentPackage("data")
public class WarehousesareaAction extends BaseAction {

	private static final long serialVersionUID = 766219203177877728L;
	private List<Warehousesarea> dataList;
	@Resource
	private WarehousesareaService warehousesareaService;

	public String index() {
		pageFlag = "index";
		System.out.println("WarehousesareaAction index");
		dataList = warehousesareaService.getAll();
		return "index";
	}

	public String list() {
		pageFlag = "list";
		System.out.println("WarehousesareaAction list");
		dataList = warehousesareaService.getAll();
		JSONArray jsonList = JSONArray.fromObject(dataList);
		return ajax(jsonList);
	}

	public List<Warehousesarea> getDataList() {
		return dataList;
	}

	public void setDataList(List<Warehousesarea> dataList) {
		this.dataList = dataList;
	}

}
